// components/tabControl/tabControl.js
Component({
  properties: {
    itemName: {
      type: Array,
      default: []
    },
  },
  data: {
    tabIndex: 0,
  },
  attached() {
 
  },

  methods: {
    initIndex(index){
      this.setData({
        tabIndex: index,
      });
    },
    //获取点击事件
    handleItem(e) {
      const index = e.currentTarget.dataset.index;
      this.setData({
        tabIndex: index,
      });
      this.triggerEvent("tabClick", index);
    },
  },
});
